package cn.fraudmetrix.octopus.modules.jacoco.controller;

import cn.fraudmetrix.octopus.modules.jacoco.dao.JacocoCoverageDao;
import cn.fraudmetrix.octopus.modules.jacoco.entity.JacocoCoverageEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author libao.zheng
 * @email libao.zheng@tongdun.cn
 * @date 2018/11/29 14:33
 */
@RestController
@RequestMapping("/jacoco/coverage")
public class JacocoCoverageController {
    @Resource
    private JacocoCoverageDao jacocoCoverageDao;
    private final Logger LOGGER = LoggerFactory.getLogger(getClass());

    @PostMapping("/queryAll")
    public List<JacocoCoverageEntity> queryAll() {
        return jacocoCoverageDao.queryAll();
    }

    @PostMapping("/query")
    public List<JacocoCoverageEntity> query(@RequestBody JacocoCoverageEntity jacocoCoverageEntity) {
        return jacocoCoverageDao.query(jacocoCoverageEntity);
    }

}
